package net.xinqushi.reflect;

import java.lang.reflect.Method;

public class ClassTest {

    public static void main(String[] args) {
        System.out.println(ClassTest.class.getClass());
        //Class<?> clazz = ClassTest.class.getClass();
        Class<? extends ClassTest> aClass = new ClassTest().getClass();
        Method reflectMethod = null;
        try {
            reflectMethod = aClass.getDeclaredMethod("reflect1", String.class);
            Object a = "123";
            reflectMethod.invoke(aClass.newInstance() , a.toString());
//            for(Method method : clazz.getMethods()){
//                System.out.println(method);
//            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void reflect1(String name){
        System.out.println(name);
    }
}
